//
//  QXHomeTitleBtn.swift
//  QXWeibo
//
//  Created by QinXin on 15/6/26.
//  Copyright © 2015年 labi3285_Lab. All rights reserved.
//

import UIKit

class QXHomeTitleBtn: UIButton {
    
    class func create(title: String) -> QXHomeTitleBtn {
        
        let titleBtn = QXHomeTitleBtn()
        titleBtn.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        titleBtn.bounds = CGRectMake(0, 0, 120, 30)
        titleBtn.setTitle(title, forState: UIControlState.Normal)
        titleBtn.setImage(UIImage(named: "navigationbar_arrow_down"), forState: UIControlState.Normal)
        titleBtn.sizeToFit()
        return titleBtn
    }
    
    override func layoutSubviews() {
        
        super.layoutSubviews()
        
        titleLabel?.frame.origin.x = 0
        imageView?.frame.origin.x = titleLabel!.frame.width
    }
    
    
}
